import request from '@/utils/request'

// 人群包列表
export function getCrowdPackageList(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/list',
    method: 'post',
    data
  })
}

// 人群包详情
export function getCrowdPackageDetail(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/detail',
    method: 'get',
    params: data
  })
}


// 创建人群包
export function crowdPackageCreate(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/create',
    method: 'post',
    data
  })
}

// 编辑人群包
export function crowdPackageEdit(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/edit',
    method: 'post',
    data
  })
}

// 获取客户筛选条件下的有效客户数
export function crowdPackageGetCust(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-valid-cust',
    method: 'post',
    data
  })
}

// 获取文件上传有效手机号数
export function crowdPackageGetMobile(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-file-valid-mobile',
    method: 'post',
    data
  })
}

// 删除人群包
export function crowdPackageDel(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/del',
    method: 'get',
    params: data
  })
}

// 人群包文件上传模板下载
export function getCrowdPackageTemplate() {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-crowd-package-template',
    method: 'get'
  })
}

// 人群包名单
export function getCrowdRoster(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/roster',
    method: 'post',
    data
  })
}

// 创建外呼任务
export function createAiTask(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/create-ai-task',
    method: 'post',
    data
  })
}

// 获取外呼任务job执行进度
export function getAiJobProcess(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-ai-job-process',
    method: 'get',
    params: data,
    noNeedLoading: true
  })
}

// 获取呼叫时间组
export function getCalltimeGroup(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-calltime-group',
    method: 'get',
    params: data
  })
}

// 获取话术分组列表
export function getWordsGroup(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-words-group',
    method: 'get',
    params: data
  })
}

// 获取线路列表
export function getCallerLine(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-caller-line',
    method: 'get',
    params: data
  })
}

// 获取创建AI外呼任务初始化数据
export function getAiTaskInit(data: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-ai-task-init',
    method: 'get',
    params: data
  })
}

//人群包高级配置
 export function advancedSetup(data: any) {
  return request({
    url: '/scrm-api/console/common/advanced-setup',
    method: 'post',
    data: data
  })
 }

//获取高级设置
export function getAdvanced(data: any) {
  return request({
    url: '/scrm-api/console/common/get-advanced-setup',
    method: 'get',
    params: data
  })
}
// 获取AI账户信息
export function getAiAccountInfo(data?: any) {
  return request({
    url: '/scrm-api/console/customer/crowd-package/get-ai-account-info',
    method: 'get',
    params: data
  })
}

//更新人群包
export function updatePackage() {
  return request({
    url: '/scrm-api/console/customer/crowd-package/update-crowd-package',
    method: 'get'
  })
}
